package com.danbay.framework.http.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;
import org.springframework.context.annotation.Bean;

import javax.servlet.Servlet;

/**
 *
 * @author SJG
 * @date 2017/9/28
 */
public class HttpConfig {

    @ConditionalOnClass({ Servlet.class, ServerProperties.Tomcat.class })
    public static class EmbeddedTomcat {

        @Bean
        public TomcatEmbeddedServletContainerFactory tomcatEmbeddedServletContainerFactory() {
            return new TomcatEmbeddedServletContainerFactory();
        }

    }
}
